home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
kermit.columbia.edu
/
kermit.columbia.edu.tar
/
kermit.columbia.edu
/
newsgroups
/
misc.20010921-20020314
/
000214_fdc@columbia.edu_Fri Dec 7 09:52:39 EST 2001.msg
< prev
next >
Wrap
Text File
|
2002-03-13
|
3KB
|
93 lines
Article: 13039 of comp.protocols.kermit.misc
Path: newsmaster.cc.columbia.edu!news.columbia.edu!news-not-for-mail
From: fdc@columbia.edu (Frank da Cruz)
Newsgroups: comp.os.linux.misc,comp.protocols.kermit.misc
Subject: Re: Can't open("/dev/tty",O_RDWR) in RH7.1/ia64
Date: 7 Dec 2001 09:52:23 -0500
Organization: Columbia University
Lines: 76
Message-ID: <9uql37$m2c$1@watsol.cc.columbia.edu>
References: <9uofq3$otq$1@watsol.cc.columbia.edu> <3C101149.5050103@redhat.com>
NNTP-Posting-Host: watsol.cc.columbia.edu
X-Trace: newsmaster.cc.columbia.edu 1007736745 18990 128.59.39.139 (7 Dec 2001 14:52:25 GMT)
X-Complaints-To: postmaster@columbia.edu
NNTP-Posting-Date: 7 Dec 2001 14:52:25 GMT
Xref: newsmaster.cc.columbia.edu comp.os.linux.misc:529781 comp.protocols.kermit.misc:13039
In article <3C101149.5050103@redhat.com>,
Michael Lee Yohe <myohe+USENET@redhat.com> wrote:
: > open() returns -1 with errno = 6 ("No such device or address")
: > on the following platform:
:
: Can you interact with /dev/tty? For instance, can you type "cat
: /dev/tty", type things and see them echo'd back?
:
When I first log in (over Telnet):
Warning: no access to tty (Inappropriate ioctl for device).
Thus no job control in this shell.
Then:
spe190> cat > /dev/tty
/dev/tty: No such device or address.
spe190>
Also, somebody else suggested that, despite the "man 2 open" statement:
mode should always be specified when O_CREAT is in the
flags, and is ignored otherwise.
I should include the third argument:
#include <stdio.h>
extern int errno;
main() {
int fd;
errno = 0;
fd = open("/dev/tty",2,0);
if (fd < 1) {
printf("fd = %d\n",fd);
printf("errno = %d\n",errno);
perror("/dev/tty");
exit(1);
} else {
printf("OK\n");
exit(0);
}
}
Result (same as before):
fd = -1
errno = 6
/dev/tty: No such device or address
Again, the platform details:
uname -a:
Linux spe190 2.4.9-12smp #1 SMP Tue Oct 30 17:55:42 EST 2001 ia64 unknown
/etc/issue:
Red Hat Linux release 7.1 (Seawolf)
Kernel 2.4.9-12smp on a 4-processor ia64
ls -l /dev/tty:
crw-rw-rw- 1 root root 5, 0 Dec 5 12:28 /dev/tty
Here's another peculiarity I noticed:
cat > open.c
(paste...)
^D
make open
make: *** Warning: File `open.c' has modification time in the future
(2001-12-07 09:39:23 > 2001-12-07 09:38:58)
cc open.c -o open
make: warning: Clock skew detected. Your build may be incomplete.
This is strange because I created the file with cat, so it got the system
time, not some random time from a remote file system.
- Frank